Focus control apparatus, image sensor, program and storage medium

ABSTRACT

A digital camera has distance measurement zone setting means ( 12 ) for dividing distance to a subject into a plurality of distance measurement zones; distance measurement zone selection means ( 13 ) for selecting a distance measurement zone to be scanned; an autofocus evaluation calculation circuit ( 14 ) for acquiring an AF evaluation value by scanning the selected distance measurement zone; zone-update determination means ( 15 ) for determining, through use of the AF evaluation value, whether or not to update a distance measurement zone to be scanned; and in-focus position decision means ( 16 ) for appropriately updating the scanned distance measurement zone based upon the determination as to whether to update the distance measurement zone, and deciding an in-focus position based upon acquisition of AF evaluation value. A focusing lens ( 2 ) is driven to the in-focus position by a focusing-lens drive circuit ( 17 ).

This application is a divisional application of U.S. Ser. No.10/661,210, filed Sep. 12, 2003, now U.S. Pat No. 6,970,646, which isincorporated by reference in its entirety.

FIELD OF THE INVENTION

This invention relates to a focus control apparatus capable ofshortening distance measurement time by dividing subject distance into aplurality of distance measurement zones and scanning each of thedistance measurement zones in succession, as well as to an image sensorhaving this apparatus, a program applicable to this apparatus andstorage medium on which the program has been stored.

BACKGROUND OF THE INVENTION

Image sensors in digital cameras and the like often adopt an autofocus(“AF” below) method referred to as the TV-AF method. This method movesthe focus position within a certain range and calculates distance to thesubject using an AF evaluation signal at each of a number of pointswithin this range (e.g., see the specification of Japanese PatentApplication Laid-Open no. 3-68280). The AF evaluation signal is computedby extracting a signal component of a prescribed band using a BPF(bandpass filter), etc. The more the subject is in focus, the greaterthe signal computed.

For example, if the distance from infinity to 50 cm is adopted as therange of distance measurement, as shown in FIG. 10, an AF evaluationsignal at a focus position for focusing on infinity is acquired and thenAF evaluation signals at each of a number of distances are acquiredsuccessively while making the focus position approach to a distance of50 cm. AF control is subsequently carried out through a method ofcomparing the AF evaluation signals acquired at each of the distancesand taking the focus position to be at a subject distance A judged toprovide the best focus. (The subject distance A corresponds to the peakof the AF evaluation signal.)

It is usually difficult to acquire AF evaluation signals continuouslywhile assigning focus positions. In many cases, therefore, AF evaluationsignals are acquired upon downsampling AF evaluation signals atintervals of distances equivalent to depth of field.

However, in the case of a digital camera having a long focal length anda broad range of focus movement or a digital camera having a shallowdepth of field and requiring fine movement of focus, the prior art issuch that it is necessary to increase greatly the number of data samples(AF evaluation signals) acquired with regard to the range of distancemeasurement. As a consequence, acquiring the data takes time and, hence,the time needed for AF control is prolonged.

SUMMARY OF THE INVENTION

Accordingly, an object of the present invention is to provide a focuscontrol apparatus that makes it possible to shorten autofocus time byraising autofocus speed without lowering autofocus precision even in acase where a large number of samples of autofocus evaluation signals arerequired with respect to range of distance measurement, as well as animage sensor having this apparatus, a program applicable to thisapparatus and a storage medium on which the program has been stored.

According to the present invention, the foregoing object is attained byproviding a focus control apparatus for detecting in-focus position of afocusing optical system by performing scanning for driving the focusingoptical system in accordance with a prescribed range of a subjectdistance, comprising: zone dividing means for dividing the subjectdistance into a plurality of distance measurement zones; zone selectionmeans for selecting a distance measurement zone to be scanned; in-focusstate acquisition means for acquiring the in-focus state of the focusingoptical system by scanning the selected distance measurement zone;zone-update determination means for determining, through use of thein-focus state, whether or not to update a distance measurement zone tobe scanned; and in-focus position decision means for deciding anin-focus position of the focusing optical system based upon updating ofthe distance measurement zone to be scanned, which is based upon theupdate determination, and the acquisition of the in-focus state.

Further, according to the present invention, the foregoing object isattained by providing a focus control apparatus for detecting in-focusposition of a focusing optical system by performing scanning for drivingthe focusing optical system in accordance with a prescribed range of asubject distance, comprising: zone dividing means for dividing thesubject distance into a plurality of distance measurement zones; zoneselection means for selecting a distance measurement zone to be scanned;in-focus state acquisition means for acquiring the in-focus state of thefocusing optical system by scanning the selected distance measurementzone; in-focus discrimination means for discriminating whether or notfocus has been achieved using the in-focus state; zone updating meansfor successively updating the distance measurement zone to be scanned;and update-execution determination means for determining whether or notto execute updating of the distance measurement zone in dependence uponresult of in-focus discrimination.

Thus, in accordance with the present invention, as described above,subject distance is divided into a plurality of distance measurementzones and a distance measurement zone to be scanned is selected. Thein-focus state of the focusing optical system is acquired by scanningthe selected distance measurement zone and whether the distancemeasurement zone to be scanned is to be updated or not is determinedusing the distance-measurement information. The distance measurementzone scanned is updated appropriately and the in-focus position isdecided based upon the acquisition of the in-focus state. In cases wherethe subject is found quickly, therefore, it is no longer necessary toscan other distance measurement zones. As a result, it is possible torealize a focus control apparatus and an image sensor having thisapparatus in which autofocus time is shortened by raising autofocusspeed without lowering autofocus precision even in a case where thereare a large number of samples of the in-focus state required withrespect to the range of distance measurement.

Further, in accordance with the present invention, subject distance isdivided into a plurality of distance measurement zones and a distancemeasurement zone to be scanned is selected. The in-focus state of thefocusing optical system is acquired by scanning the selected distancemeasurement zone and whether focus has been achieved is discriminatedusing the in-focus state. The distance measurement zone to be scanned isupdated successively. Whether updating of the distance measurement zoneis to be executed or not is determined in dependence upon the result ofthe in-focus discrimination. In cases where the subject is foundquickly, therefore, it is no longer necessary to scan other distancemeasurement zones. As a result, as set forth above, it is possible torealize a focus control apparatus and an image sensor having thisapparatus in which autofocus time is shortened.

Further, by changing a requirement for determining updating of thedistance measurement zone and the requirement for in-focusdiscrimination in dependence upon the history of updating of thedistance measurement zone, it is possible to carry out more suitabledetermination of updating of the distance measurement zone anddiscrimination of the in-focus state.

Even if there are a plurality of distance-measurement positions,division is made into a plurality of distance measurement zones, thein-focus state of the focusing optical system is acquired by scanning aselected distance measurement zone and scanning can be halted when it isjudged that the in-focus state has been obtained based upon the in-focusstate. This makes it possible to shorten autofocus time by raisingautofocus speed, as set forth above.

Further, by changing the order in which distance measurement zones areupdated in accordance with photographic conditions or mode ofphotography and changing the number of distance measurement zones intowhich the subject distance is divided in accordance with focal length orf-stop at the time of photography, it is possible to shorten autofocustime by raising autofocus speed, as set forth above.

Other objects and advantages besides those discussed above shall beapparent to those skilled in the art from the description of a preferredembodiment of the invention which follows. In the description, referenceis made to accompanying drawings, which form a part thereof, and whichillustrate an example of the invention. Such example, however, is notexhaustive of the various embodiments of the invention, and thereforereference is made to the claims which follow the description fordetermining the scope of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating the structure of a digital cameraequipped with an autofocus apparatus according to a first embodiment ofthe present invention;

FIG. 2 is a diagram illustrating an example in which a distancemeasurement zone has been divided into a plurality of zones independence upon subject distance;

FIG. 3 is a flowchart illustrating an AF operation when a distancemeasurement zone has been divided;

FIG. 4 is a flowchart illustrating processing for determining updatingof a distance measurement zone;

FIG. 5 is a diagram illustrating an example of a relationship betweenthe range of each distance measurement zone and an AF evaluation value;

FIG. 6 is a diagram illustrating positions of AF frames in a case wherenine AF frames have been set in accordance with a second embodiment ofthe present invention;

FIG. 7 is a flowchart illustrating processing for determining updatingof a distance measurement zone in a case where a plurality of AF framesexist;

FIG. 8 is a diagram illustrating an example of a relationship betweenfocal length and number of divisions of distance measurement zonesaccording to a third embodiment of the present invention;

FIGS. 9A and 9B are diagrams illustrating relationships between F-numberand number of divisions of distance measurement zones, in which FIG. 9Aillustrates an example of division into distance measurement zones whenthe F-number is 5.6 and FIG. 9B an example of division into distancemeasurement zones when the F-number is 4.0; and

FIG. 10 is a diagram illustrating an example of a relationship betweensubject distance and AF evaluation value.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

An overview of a mode of the present invention will be described first.According to this mode of practicing the invention, which relates to animage sensor such as that of a digital camera having an autofocusfunction, subject distance is divided into a plurality of distancemeasurement zones and a distance measurement zone to be scanned isselected from the plurality of distance measurement zones. (Scanningrefers to an operation for driving a focusing optical system inaccordance with a prescribed range of subject distance.) An AFevaluation value is acquired by scanning the selected distancemeasurement zone, the distance measurement zone to be scanned is updatedappropriately based upon the update determination and the in-focusposition is decided based upon the AF evaluation value. This shortensthe AF time by raising the AF speed.

Embodiments of the present invention will be described in detail belowwith reference to the drawings.

First Embodiment

A first embodiment of the present invention will be described for a casewhere the autofocus apparatus of the invention is applied to a digitalcamera.

FIG. 1 is a block diagram illustrating the structure of a digital cameraequipped with an autofocus apparatus according to a first embodiment ofthe present invention. The digital camera has an optical system 1, afocusing lens 2, an image sensing device 3, a preprocessing circuit 4,an A/D converter 5, a memory controller 6, a memory 7, a recordingmedium 8, a switch (SW1) 9, a switch (SW2) 10, a control unit 11,distance measurement zone setting means 12, distance measurement zoneselection means 13, an AF evaluation value calculation circuit 14,zone-update determination means 15, in-focus position decision means 16and a focusing-lens drive circuit 17.

The optical system 1 causes the image of a subject to impinge upon theimage sensing device 3 via the focusing lens 2, which is driven over aselected range of distance measurement. The image sensing device 3opto-electronically converts the image of the subject to an electricsignal. The preprocessing circuit 4 has a CDS circuit for eliminatingoutput noise and a non-linear amplifying circuit for applying non-linearamplification before an A/D conversion is performed. The A/D converter 5converts an analog signal, which is output from the preprocessingcircuit 4, to a digital signal. The memory controller 6 stores thedigital signal, which is output from the A/D converter 5, in the memory7. The recording medium 8 records images. The switch (SW1) 9 is pressedwhen the focusing lens 2 is to be driven, and the switch (SW2) 10 ispressed when a picture is to be taken.

The control unit 11 controls each component of the digital camera tothereby control various operations, which include an AF operation. Thecontrol unit 11 executes processing, which is represented by flowchartsdescribed later, based upon a program stored within the digital cameraor a program supplied externally. The distance measurement zone settingmeans 12 divides the subject distance into a plurality of distancemeasurement zones. The AF evaluation value calculation circuit 14calculates an AF evaluation value by extracting mid- and high-frequencycomponents of the signal acquired by the image sensing device 3. Thezone-update determination means 15 determines whether or not to update adistance measurement zone based upon the AF evaluation value. Thein-focus position decision means 16 decides the in-focus position basedupon repetitive updating of the distance measurement zone andacquisition of the AF evaluation value. The focusing-lens drive circuit17 drives the focusing lens 2 to the in-focus position.

The digital camera according to the first embodiment is such that light(the image of the subject) whose image has been formed on the imagesensing device 3 by the optical system 1 and focusing lens 2 at the timeof photography is opto-electronically converted by the image sensingdevice 3, and the resulting signal is converted to a digital signalthrough the preprocessing circuit 4, which has the CDS circuit thateliminates output noise and the non-linear amplifying circuit thatapplies non-linear amplification prior to the A/D conversion, and theA/D converter 5. The digital signal is stored in the memory 7 via thememory controller 6, and the digital signal that has been stored in thememory 7 is converted to an image by a signal processing circuit (notshown), after which the image is recorded on the recording medium 8.

The operation of the digital camera in the first embodiment constructedas set forth above will be described in detail while referring to FIGS.1 to 5.

The AF operation will now be described. The AF operation is controlledby the control unit 11. First, if the switch (SW1) 9 is pressed by thephotographer, the subject distance is divided into a plurality ofdistance measurement zones by the distance measurement zone settingmeans 12, the focusing lens 2 is driven by the focusing-lens drivecircuit 17 so as to scan a distance-measurement range (distancemeasurement zone) that has been selected by the distance measurementzone selection means 13, and a signal is acquired by the image sensingdevice 3. The signal that has been acquired by the image sensing device3 is applied to the AF evaluation value calculation circuit 14, whichextracts mid-to-high frequency components using a BPF, whereby thesignal is converted to an AF evaluation value (the value of the AFevaluation signal) at each scanned point.

Whether or not to perform distance measurement in another distancemeasurement zone is determined by the zone-update determination means 15based upon the AF evaluation value at each scanned point. After theupdating of the distance measurement zone by the zone-updatedetermination means 15 and the acquisition of the AF evaluation value bythe AF evaluation value calculation circuit 14 have been repeated, thein-focus position is decided by the in-focus position decision means 16based upon the AF evaluation value that prevails following the end ofthe scan and the focusing lens 2 is driven to this in-focus position bythe focusing-lens drive circuit 17. Picture-taking is executed inresponse to the switch (SW2) 10 being pressed by the photographer underthese conditions.

The AF operation will now be described in greater detail.

The first embodiment will be described on the assumption that the lensis a fixed focal length lens and that there is a single AF frame(distance-measurement position), which is an area displayed on thedisplay screen of the digital camera. Further, it is assumed that therange of distance measurement is from infinity to, e.g., 50 cm. Thedistance measurement zone is divided into, e.g., three portions, asshown in FIG. 2, by the distance measurement zone setting means 12. FIG.2 is a diagram illustrating the relationship between subject distanceand distance measurement zones. This is an example in which distancemeasurement zones 1, 2 and 3 are assumed to be 2 m to infinity, 1 m to 2m and 50 cm to 1 m, respectively. The method of dividing the objectdistance into distance measurement zones may be decided at willdepending upon distance measuring speed, which subject distance is to begiven priority, or the photographic conditions. Further, the number ofdistance measurement zones into which division is made can be changed independence upon focal length at the time of photography and the f-stopat the time of photography. In this case, the longer the focal length,the larger the number of distance measurement zones may be made, and thegreater the aperture is stopped down, the smaller the number of distancemeasurement zones may be made.

Next, the order of the distance measurement zones scanned is decided bythe distance measurement zone selection means 13. In this example, theorder is assumed to be, e.g., distance measurement zone 1→distancemeasurement zone 2→distance measurement zone 3. In this case, this meansthat scanning is performed from where the subject distance is far away,as illustrated in FIG. 2. Besides the above, scanning may be performedfrom where the subject distance is nearby, as in the manner distancemeasurement zone 3→distance measurement zone 2→distance measurement zone1, or scanning may be performed in the manner distance measurement zone2→distance measurement zone 1→distance measurement zone 3. The purposeof dividing object distance into the distance measurement zones is toshorten AF time by finding the subject quickly and then halting scanningat this point. This means that it is desirable to perform scanning froma distance measurement zone in which there is a high probability thatthe subject will be present.

Accordingly, the order of the distance measurement zones scanned can bechanged depending upon the mode of photography as follows: It may be soarranged that scanning is performed from far to near in a case where apicture is taken in a scene photography mode and from near to far in acase where a picture is taken in a portrait photography mode. This willmake it possible to achieve focus more quickly on the subject intendedby the photographer.

Next, reference will be had to the flowchart of FIG. 3 to describe theflow of processing up to successive scanning of the distance measurementzones set as described above, acquisition of AF evaluation values andfinal decision of the in-focus position. The processing illustrated inthis flowchart is executed by having the control unit 11 control eachcomponent of the digital camera of FIG. 1 based upon a program.

At step S1 in FIG. 3, the distance measurement zone setting means 12sets the distance measurement zone to be scanned. In a case where theupdating order of the distance measurement zones is distance measurementzone 1→distance measurement zone 2→distance measurement zone 3, firstthe distance measurement zone 1 is set. Next, at step S2, the distancemeasurement zone that has been set by the distance measurement zonesetting means 12 is scanned, whereby an AF evaluation value is acquiredby the AF evaluation value calculation circuit 14. The AF evaluationvalue may be calculated by applying BPF-based filtering processing tothe signal obtained by photography, extracting mid- and high-frequencycomponents of this signal and then adopting the maximum value ofamplitude within the AF frame as the AF evaluation value. Alternatively,calculation may include extracting the maximum value along the X axis infiltering by the BPF within the AF frame, integrating maximum valuesalong the direction (Y-axis) perpendicular to the direction of the Xaxis of the BPF, and adopting the integrated value as the AF evaluationvalue.

Next, at step S3, the zone-update determination means 15 executeszone-update determination processing for determining whether or not toupdate the distance measurement zone based upon the AF evaluation valueacquired by the AF evaluation value calculation circuit 14.Specifically, in zone-update determination processing, whether to updatethe distance measurement zone or not is determined based upon thedifference between maximum and minimum levels of the AF evaluation valueand the manner in which the AF evaluation value rises at the end of thedistance measurement zone.

The details of processing for determining updating of the distancemeasurement zone at step S3 will be described based upon the flowchartof FIG. 4. The processing illustrated in this flowchart is executed byhaving the control unit 11 control each component of the digital cameraof FIG. 1 based upon a program.

At step S11 in FIG. 4, first the zone-update determination means 15calculates Afdiff1=Afmax−Afmin, which is the difference between amaximum value Afmax and minimum value Afmin of all AF evaluation valuesin distance measurement zones scanned thus far. Next, at step S12, thezone-update determination means 15 determines whether the calculateddifference Afdiff1 is greater than a threshold value TH1. IfAfdiff1>threshold value TH1 is found to hold, the zone-updatedetermination means 15 determines that the AF evaluation signal haspeaked (i.e., that the peak of the AF evaluation signal has been found)and renders an “OK” decision (i.e., decides that the distancemeasurement zone is not to be updated). If it is found thatAfdiff1>threshold value TH1 does not hold, the zone-update determinationmeans 15 renders an “NG” decision (i.e., determines that the distancemeasurement zone is to be updated).

The manner in which the AF evaluation value rises at the end of adistance measurement zone is for judging whether the AF evaluation valueis rising on the very near side in the distance measurement zone 1, asshown for example in FIG. 5. That is, at step S13, the zone-updatedetermination means 15 calculates the differenceAfdiff2=Afsikin−Afsikin−1, which is the difference between the AFevaluation value Afsikin on the nearest side in the distance measurementzone 1 and the immediately preceding AF evaluation value Afsikin−1, andcompares the result of calculation with a threshold value TH2 at stepS14. If it is found that the result is greater than the threshold valueTH2, the zone-update determination means 15 judges that the AFevaluation value at the end of the distance measurement zone is risingand renders the NG decision (the decision to update the distancemeasurement zone) by reason of the fact that the peak of the AFevaluation signal in FIG. 5 is located in another distance measurementzone. If it is found that the result is equal to less than the thresholdvalue TH2, then the zone-update determination means 15 renders the OKdecision (the decision not to update the distance measurement zone).

It should be noted that the threshold value TH1 used in determiningupdating of the distance measurement zone need not be a fixed value; itmay be changed depending upon the number of distance measurement zonesscanned thus far. That is, the greater the number of distancemeasurement zones observed (the greater the number of distancemeasurement zones into which division is made), the more likely asignificant difference between the peak of the AF evaluation signal andthe minimum level should manifest itself. If there are a large number ofzones, therefore, it possible to adopt a large threshold value. Further,the fewer the distance measurement zones, the more difficult it will befor a difference between the maximum and minimum levels of the AFevaluation value to appear, and hence in this case it is better to adopta small threshold value. Thus, by changing the requirement fordetermining updating of the distance measurement zone in dependence uponthe zone update history, it is possible to carry out more suitabledetermination of updating of the distance measurement zone.

Furthermore, the parameter (requirement for determining updating of thedistance measurement zone) may be changed in dependence upon the mode ofphotography. For example, in a case where the S/N ratio of the AFevaluation value can be assumed to be poor because the subject is dark,as in a mode for photographing a night scene, it may be arranged so asto make updating of the distance measurement zone as easy as possibleand observe (calculate) a subject distance over a wide range.

In a case where the two zone update requirements of steps S12 and S14both receive “OK” decisions, it is decided not to update the distancemeasurement zone at step S15. Otherwise, it is decided to update thedistance measurement zone at step S16.

With reference again to FIG. 3, it is determined at step S4 whether toupdate the distance measurement zone using the result of zone updatedetermination processing of FIG. 4. If the zone-update determinationmeans 15 has decided to update the distance measurement zone, then, atstep S5, it is determined whether the above-described processing hasended with regard to all of the distance measurement zones. If thezone-update determination means 15 has determined that the distancemeasurement zone is not to be updated, then control proceeds to step S6,which is processing for determining the in-focus position. If thezone-update determination means 15 has decided to update the distancemeasurement zone and, moreover, the above-described processing has notended with regard to all distance measurement zones at step S5, then thenext distance measurement zone is set at step S1. If the above-describedprocessing has ended with regard to all distance measurement zones, thencontrol proceeds to step S6, namely processing for determining thein-focus position.

In processing for determining the in-focus position at step S6, firstthe in-focus position decision means 16 calculates the in-focus positionafter it has discriminated the in-focus state. Discrimination of thein-focus state involves obtaining Afdiff1 (=Afmax−Afmin), in a mannersimilar to that of processing for determining zone update describedabove, based upon all AF evaluation values of distance measurement zonescanned thus far, and comparing Afdiff1 with a threshold value TH3. Thein-focus position decision means 16 determines that focusing is possibleif Afdiff1>TH3 holds and is impossible if Afdiff1>TH3 does not hold. Iffocusing is possible, the maximum value of AF evaluation values isadopted as the in-focus position. It should be noted that therequirement for discriminating the in-focus state can be changed independence upon the history of zone update. Further, if it isdiscriminated that focusing is possible, updating the distancemeasurement zones is terminated.

By changing the setting of the threshold value TH1 in the processing fordetermining zone update and the setting of the threshold value TH3 inthe processing for determining the in-focus position, it is possible tomake the updating of the distance measurement zones easier or moredifficult. For example, if the threshold value TH1 is greater than thethreshold value TH3, the OK decision (the decision not to update thedistance measurement zone) will not be rendered unless the differencebetween the high and low levels of the AF evaluation signal becomescorrespondingly large. As a consequence, updating of the distancemeasurement zone becomes easier. Further, the determination regardingupdating of the distance measurement zone may be made exactly the sameas the determination regarding the in-focus state.

Thus, in accordance with the first embodiment, as described above,subject distance is divided into a plurality of distance measurementzones and a distance measurement zone to be scanned is selected. An AFevaluation value is acquired by scanning the selected distancemeasurement zone and whether the distance measurement zone to be scannedis to be updated or not is determined using the AF evaluation value. Thedistance measurement zone scanned is updated appropriately and thein-focus position is decided based upon the acquisition of the AFevaluation value. In cases where the subject is found quickly,therefore, it is no longer necessary to scan other distance measurementzones. As a result, focusing time can be shortened correspondingly. Evenin this case there is no decline in focusing performance of AF control.

Accordingly, it is possible to realize a focus control apparatus and adigital camera having this apparatus in which autofocus time isshortened by raising autofocus speed without lowering autofocusprecision even in a case where there are a large number of samples of AFevaluation signals required with respect to the range of distancemeasurement.

Second Embodiment

A second embodiment of the present invention will be described for acase where the autofocus apparatus of the present invention is appliedto a digital camera and, moreover, there are a plurality of AF frames(distance-measurement positions) on the screen of the digital camera.The second embodiment differs from the first embodiment in that theprocessing for determining updating of the distance measurement zone ischanged owing to the presence of a plurality of AF frames. The secondembodiment will be described for a case where there are nine frames, asdepicted in FIG. 6. It should be noted that the structure of the digitalcamera in the second embodiment is the same as that of the firstembodiment (see FIG. 1) and need not be described again.

The operation of the digital camera in the second embodiment thusconstructed will be described in detail with reference to FIGS. 1, 6 and7.

The flow of processing of the AF operation in the second embodiment issimilar to that of the flowchart of FIG. 3 according to the firstembodiment; only the processing of step S3 for determining updating ofthe distance measurement zone is different. The second embodiment willbe described with regard to this processing for determining updating ofthe distance measurement zone. Further, the order of zone updating ischanged so that updating is from far to near.

In addition, the discrimination of the state of the curve of the AFevaluation signal in each AF frame in the second embodiment is similarto that of the flowchart of FIG. 4 according to the first embodiment. Inthe second embodiment, if a “NO” decision is rendered at step S14, thestate of the crest of the AF evaluation signal is expressed by ◯ (thismeans that the signal has a peak in the particular distance measurementzone); if a “YES” decision is rendered at step S14, the state of thecrest is expressed by Δ (this means that the signal has a peak inanother distance measurement zone); and if a “NO” decision is renderedat step S12, the state of the crest is expressed by × (this means thatthe signal has no peak in the particular distance measurement zone).

Next, the flow of the processing for determining zone update will bedescribed with reference to the flowchart of FIG. 7. The processingillustrated in this flowchart is executed by having the control unit 11control each component of the digital camera of FIG. 1 based upon aprogram.

At step S21 in FIG. 7, the zone-update determination means 15investigates the states of the AF evaluation values in the threeintermediate AF frames among the nine upper, intermediate and lower AFframes in FIG. 6. Control proceeds to step S26, at which the zone-updatedetermination means 15 determines that the distance measurement zone isnot to be updated, only if ◯ is indicated for all three of theintermediate frames. All nine of the upper, intermediate and lower AFframes are not investigated because it is considered here that theintermediate AF frames have priority. This is so that even if a subjectat short distance is within an upper or lower AF frame, focus will notbe pulled in that direction (e.g., so that the main subject will not bebrought into focus in an upper or lower AF frame in a case where themain subject is located in an intermediate AF frame). Further, thereason for investigating the three intermediate AF frames rather than asingle center point is to prevent erroneous distance measurement inautofocus in case of a scene where the center is empty, as when the mainsubject is not centrally located.

If a “NO” decision is rendered at step S21 (i.e., if not all of theintermediate frames are ◯), then, at step S22, the zone-updatedetermination means 15 determines whether updating of the distancemeasurement zone is from the second onward. If updating of the distancemeasurement zone is the from the second onward, then the zone-updatedetermination means 15 determines at step S27 that the distancemeasurement zone is to be updated. The reason for determining whetherupdating of the distance measurement zone is from the second onward isas follows: If the subject distance is divided into the distancemeasurement zones finely, there is a possibility that only the base ofthe crest of the AF evaluation signal will be scanned. Hence, thedetermination concerning updating of the distance measurement zones iscarried out after investigating a plurality of distance measurementzones as much possible so as to avoid an “x” determination from beingmade owing to observation solely of the base of a crest despite the factthat the signal actually has a peak.

If a “YES” decision is rendered at step S22 (i.e., if updating of thedistance measurement zone is from the second onward), then, at step S23,the zone-update determination means 15 investigates the state of the AFevaluation value in the intermediate AF frames and checks to see whether“Δ” holds for the intermediate frames. If “Δ” holds for the intermediateframes, then the zone-update determination means 15 interprets this asmeaning that the peak of the AF evaluation signal is still in anotherdistance measurement zone and determines at step S27 that the distancemeasurement zone is to be updated. If “Δ” does not hold for theintermediate frames, then, at step S24, the zone-update determinationmeans 15 investigates the state of the AF evaluation value in theintermediate AF frames and checks to see whether “×” is indicated forall of the intermediate frames.

If not all of the intermediate frames indicate “×” (“NO” at step S24),this means that “◯” holds for any of these frames and the zone-updatedetermination means 15 determines at step S27 that the distancemeasurement zone is to be updated. If “Δ” does not hold for the upperand lower frames (“NO” at step S25), then the zone-update determinationmeans 15 determines at step S26 that the distance measurement zone isnot to be updated.

This embodiment illustrates an example of processing for determiningzone updating in a case where there are a plurality of AF frames.However, the present invention is not limited to this example and thedetermination concerning updating of the zones may be performed usingall of the AF frames at all times. In addition, priority need not begiven to the intermediate AF frames among the plurality of AF frames.

Thus, in accordance with the second embodiment, as described above, evenif there are a plurality of AF frames, subject distance is divided intoa plurality of distance measurement zones and an AF evaluation value isacquired by scanning the selected distance measurement zone. Scanningcan be halted when it is determined, based upon the AF evaluation value,that the in-focus state has been obtained. As a result, it is possibleto realize a focus control apparatus and a digital camera having thisapparatus in which AF control time is shortened by raising AF speed.

Third Embodiment

A third embodiment of the present invention will be described for a casewhere the autofocus apparatus of the present invention is applied to adigital camera equipped with a focusing lens in addition to a zoom lens.The third embodiment differs from the first embodiment in that theoptical system of the camera has a zoom lens. Structural elements of thedigital camera other than the zoom lines in the third embodiment aresimilar to those of the first embodiment (see FIG. 1) and need not bedescribed again.

The operation of the digital camera in the third embodiment thusconstructed will be described in detail with reference to FIGS. 1, 8 and9A, 9B.

The number of scanning points associated with AF time is decided by theamount of movement of the focusing lens 2 necessary to scan the range ifdistance measurement and how finely the range of distance measurement isscanned. In general, the amount of movement of the focusing lens 2increases when focal length increases. On the other hand, how finely therange of distance measurement is scanned is decided depending upon Fδ,which corresponds to focal depth (where F represents the F-number and δthe allowable diameter of circle of confusion). If the F-number does notchange due to focal length, the amount of movement of the focusing lens2 increases when the focal length increases and therefore AF time isprolonged by an amount corresponding to the increase. Accordingly, it ispreferred that the number of distance measurement zones into whichdivision is made be optimized depending upon each focal length, as shownin FIG. 8.

Further, in a case where the fineness of scanning has been changed inaccordance with a change in F-number, the manner of division intodistance measurement zones may be changed depending upon the F-number.For example, in case of a digital camera having two F-numbers of F4 andF5.6, an instance where a picture is taken at F5.6 will have a greaterfocal depth in comparison with an instance where a picture is taken atF4. An AF evaluation value therefore may be acquired more coarsely. Morespecifically, if the amount of movement of the focusing lens 2 is set tobe twice as large at the time of F5.6 photography as the amount ofmovement of the focusing lens 2 within the scanning points at the timeof F4 photography, then the number of scanning points in regard to thefull area of the range of distance measurement is approximately half ofthat at the time of F5.6 photography. Accordingly, if the number ofscanning points every distance measurement zone is set to be constant atall times, the number of distance measurement zones into which divisionis made at the time of photography at F4 will be twice that at the timeof photography at F5.6, as illustrated in FIGS. 9A, 9B.

The embodiment has been described with regard to the number of distancemeasurement zones into which division is made. However, a change may bemade in regard to the order of zone update depending upon the conditionsof photography. For example, in a case where luminance level is high atthe time of photography, it is judged that photography is beingperformed outdoors and, taking the approach that a subject in thedistance should be given priority, scanning is performed from a fardistance measurement zone to a near distance measurement zone. Further,in a case where luminance level is low at the time of photography, it isjudged that photography is being performed indoors and, taking theapproach that a subject in nearby should be given priority, scanning isperformed from a near distance measurement zone to a far distancemeasurement zone.

Further, the order of zone update may be changed depending upon the modeof photography. For example, if the camera has been set to a mode forshooting scenery, it will suffice to perform scanning giving priority toa far distance measurement zone. If the camera has been set to a modefor shooting a portrait, then scanning would be performed givingpriority to a short distance or to a distance measurement zone in whicha person is often present. Further, if a flash photography mode has beenset, portrait photography would be decided and it would suffice toperform scanning giving priority to a short distance or to a distancemeasurement zone in which a person is often present.

Thus, in accordance with the third embodiment, as described above, bychanging the number of distance measurement zones into which division ismade, the number of scanning points or the order in which distancemeasurement zones are updated in accordance with focal length or f-stopat the time of photography, it is possible to realize an autofocusapparatus and a digital camera having this apparatus that shorten AFtime by raising AF speed.

Other Embodiments

It goes without saying that the object of the invention is attained alsoby supplying a storage medium storing the program codes of the softwarefor performing the functions of the foregoing embodiments to a system oran apparatus, reading the program codes with a computer (e.g., a CPU orMPU) of the system or apparatus from the storage medium, and thenexecuting the program codes. In this case, the program codes read fromthe storage medium implement the novel functions of the embodiments andthe storage medium storing the program codes constitutes the invention.

Examples of storage media that can be used for supplying the programcode are a floppy disk (registered trademark), hard disk, optical disk,magneto-optical disk, CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW,DVD+RW, magnetic tape, non-volatile memory card and ROM, etc.

Furthermore, besides the case where the aforesaid functions according tothe embodiments are implemented by executing the program code read outby computer, an operating system or the like running on the computer mayperform all or a part of the actual processing based upon the commandsof the program code so that the functions of the foregoing embodimentsare implemented by this processing.

Furthermore, after the program read from the storage medium is writtento a function expansion board inserted into the computer or to a memoryprovided in a function expansion unit connected to the computer, a CPUor the like mounted on the function expansion board or functionexpansion unit performs all or a part of the actual processing basedupon the commands of the program code so that the functions of theforegoing embodiments can be implemented by this processing.

The present invention is not limited to the above embodiments andvarious changes and modifications can be made within the spirit andscope of the present invention. Therefore, to apprise the public of thescope of the present invention, the following claims are made.

1. A focus conrtol apparatus for detecting in-focus position of afocusing optical system by performing scanning for driving the focusingoptical system in accordance with a predetermined range of an objectdistance, comprising: a scanning area selection unit adapted to dividethe object distance into a plurality of areas and select an area to bescanned; and an in-focus state acquisition unit adapted to acquirein-focus state of the focusing optical system by scanning the selectedarea; wherein said scanning area selection unit changes a method ofdividing the area to be scanned in accordance with conditions ofphotography.
 2. The apparatus according to claim 1, wherein number ofscanning areas to be divided is changed in accordance with focal lengthat time photography.
 3. The apparatus according to claim 2, wherein thegreater the focal length at the time of photography, the larger thenumber of scanning ares to be divided is made.
 4. The apparatusaccording to claim 1, wherein number of scanning areas to be divided ischanged in accordance with f-stop value at time of photography.
 5. Theapparatus according to claim 4, wherein the more an aperture is stoppeddown, the smaller number of scanning areas to be divided is made.
 6. Animage sensor having an in-focus control apparatus defined in claim 1.